package scheduler

import (
	"gitee.com/jnshao/go-start/projects/crawler/engine"
)

// 共用channel
type SimpleScheduler struct {
	simpleSchedulerChan chan engine.Request
}

func (s *SimpleScheduler) Submit(r engine.Request) {
	go func() {
		s.simpleSchedulerChan <- r
	}()
}

func (s *SimpleScheduler) WorkerChan() chan engine.Request {
	return s.simpleSchedulerChan
}

func (s *SimpleScheduler) Run() {
	s.simpleSchedulerChan = make(chan engine.Request)
}

func (s *SimpleScheduler) WorkerReady(chan engine.Request) {

}
